set content type on api responses to json
change exception code for route not found to 404
rethrow CubexException if not catching
code tidy