cleanup routing, error messages, http codes