changed response to response_object and added more error handling in registerController