Q:

Entity Relations in Services

I have such model relations: User, Task, each user can create his own tasks and can see All tasks.  So obviously I'll have TaskService with methods getAllTasks(), getSortedTasks(String value), etc. 
I'm confused where should I have createTask(Task task), updateTask(lond id, Task task) methods - in TaskService or in UserService, because I'm told I should have REST API looks like:
rather
post users/{id}/tasks

than
post /tasks

because "a task belongs to a particular user".  So I can't choose between separate services,api for each entity and common services,api whre User is relations owner. 

A:

You should implement the endpoint for creating tasks in a task resource. 
Both is possible: 
POST your_root.com/api/{userId}/tasks/  ----> Creates task and takes the value of the creator from the uri.  
But you could also go this way: 
POST your_root.com/api/tasks/  ---> In this case you have to tell the server by JSON or XML who created the task.  The body could look like this i.E.: 
{

  "author": "user A",
  "assingee": null,
  "headline": "Login Page for my app",
  "text":"Build fancy login page"

}

Last variant and my preferred:
POST your_root.com/api/{userId}/tasks/
and the authorId in the body again:
{

  "authorId":"12"
  "author": "user A",
  "assingee": null,
  "headline": "Login Page for my app",
  "text":"Build fancy login page"

}

The advantage of the last variant is that you can check whether the userId in the uri equals the authorId of the body.  So you can avoid that this request with a certain Id is made by accident. 
Hope that helps.