Added tests for REST API.
Correct content type for JSON responses.
More tests