public void ProcessRequest(HttpContext context) { string json = ""; context.Response.ContentType = "text/json"; var tokenObject = RequestContext.RouteData.Values["token"]; var hasContent = tokenObject == null ? false : true; if (hasContent) { var token = tokenObject.ToString(); var dbAction = new DbActions(); var tokenGrant = dbAction.AreGrantedPermissions(token); if(tokenGrant.GrantedAccess) { var user = dbAction.UserData(tokenGrant.UserId); var responseData = new { Id = user.Id, Email = user.Email }; json = JsonConvert.SerializeObject(responseData); } } context.Response.Write(json); }