return 500 status on mysql errors