public IHttpActionResult GetLocation(int id)
        {
            var userId = this.User.Identity.GetUserId();

            var location = this.data.Locations.All()
                           .Where(l => l.UserID == userId)
                           .FirstOrDefault(l => l.ID == id);

            if (location == null)
            {
                return(BadRequest("No location entry with this ID"));
            }

            var locationModel = LocationDataModel.FromGeolocation(location);

            return(Ok(locationModel));
        }
        public IHttpActionResult GetLocation()
        {
            var userId = this.User.Identity.GetUserId();

            var lastLocation = this.data.Locations.All()
                               .Where(l => l.UserID == userId)
                               .OrderByDescending(l => l.CreatedOn)
                               .FirstOrDefault();

            if (lastLocation == null)
            {
                return(BadRequest("No locations in database!"));
            }

            var locationModel = LocationDataModel.FromGeolocation(lastLocation);

            return(Ok(locationModel));
        }