public IHttpActionResult GetEmployeeLocationData(string EmployeeId, DateTime Date) { try { using (MaxMasterDbEntities db = new MaxMasterDbEntities()) { var employeeLocations = db.GetEmployeeLocations(EmployeeId, Date).ToList(); return(Content(HttpStatusCode.OK, new { employeeLocations })); } } catch (Exception ex) { new Error().logAPIError(System.Reflection.MethodBase.GetCurrentMethod().Name, ex.ToString(), ex.StackTrace); return(Content(HttpStatusCode.InternalServerError, "Anerror occuured, please try again later")); } }