public HttpResponseMessage GetAllProfiles()
        {
            var allProfiles = _pathToRepository.GetAllEntities();

            if (allProfiles != null)
            {
                return(Request.CreateResponse(allProfiles));
            }
            else
            {
                return(Request.CreateResponse(System.Net.HttpStatusCode.NotFound, string.Format("List is empty")));
            }
        }
        public HttpResponseMessage PostFilm([FromUri] int id, [FromBody] WatchedMovieModel movie)
        {
            var allProfiles = _pathToRepository.GetAllEntities();
            var movieToAdd  = new WatchedMovie(new Movie(movie.Movie.Title, movie.Movie.Director, movie.Movie.Genre), movie.Date, movie.Rating);

            for (int i = 0; i < allProfiles.Length; i++)
            {
                if (allProfiles[i].Id == id)
                {
                    allProfiles[i].AddWatchedMovie(movieToAdd);
                    break;
                }
            }
            File.WriteAllText(ConfigurationManager.AppSettings["PathToRepository"], JsonConvert.SerializeObject(allProfiles.ToArray()));
            return(Request.CreateResponse
                       (System.Net.HttpStatusCode.Created,
                       string.Format("Film {0} was sucessfully added to collection of user with id {1}", movie.Movie.Title, id)));
        }