Added error message when ajax call gets an error response

Solves issue #11