Set request return object to use json_encode()