API now accepts only JSON request and returns JSON.