Fix RESTful api for friends to be consistent

POST request and response are now in JSON
Add tests for RESTful service for checking friends