how to return a json object in javascript