Fixed API, added JSON response