Changed failure response status code to 200 to avoid problems when using jQuery ajax function.