Changed Denis' API to return a JSON object instead of a text string