error handler and response format added