Clean up mysql escaping in api