added empty ajax respose, error handling via exceptions
updated error handling