use render_api_error instead of error