Improved error readability

by replacing our errorHandler with express’ errorhandler middleware.
minor cleanup in api.js