added JSON response and marshalling