[fix] api should respond with errors