Changed error handling on ajax requests

Signed-off-by: Michael 'Tekkla' Zorn <tekkla@tekkla.de>
Switched indentation from spaces to tabs

Signed-off-by: Michael 'Tekkla' Zorn <tekkla@tekkla.de>