fixed return not in json and fixes for new wso2api.class