Updated return object to return JSON