[Service] Check if the response is valid json

This PR fixes #24