changed 404 response to an exception
fixed bugs