public async Task <IActionResult> UpdateTramsLocations([FromBody] Credentials credentials)
        {
            if (!ModelState.IsValid)
            {
                return(new BadRequestResult());
            }

            try
            {
                var user = UserRepo.SearchFor(x => x.Login.Equals(credentials.Login)).Single();

                if (!user.UserRole.Role.Code.Equals("ADMIN"))
                {
                    return(Unauthorized());
                }

                if (user.Password.Equals(HashPassword(credentials.Password)))
                {
                    HttpResponseMessage response = await Client.GetAsync("https://api.um.warszawa.pl/api/action/wsstore_get/?id=c7238cfe-8b1f-4c38-bb4a-de386db7e776&apikey=a4160f82-2926-42b8-9966-a340cbd89512");

                    Task <string> responseContent = response.Content.ReadAsStringAsync();
                    Thread.Sleep(4000);

                    WarsawApiResult externalApiCallResult =
                        JsonConvert.DeserializeObject <WarsawApiResult>(responseContent.Result);
                    var listOfWebTramsLocations = externalApiCallResult.result;

                    if (listOfWebTramsLocations.Count <= 0)
                    {
                        return(NoContent());
                    }
                    context.RemoveRange(TramsRepo.GetAll());
                    context.SaveChanges();

                    var listOfTramLocations = listOfWebTramsLocations.Select(x => x.ToEntity());

                    foreach (var tramLocation in listOfTramLocations)
                    {
                        TramsRepo.Insert(tramLocation);
                    }

                    context.SaveChanges();

                    return(Ok());
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return(new BadRequestResult());
            }

            return(Unauthorized());
        }