user_endpoints: add a wrap function so that we always pass json back to the user