Returning errors and response