api/login, add shortcut methods for rendering errors and server errors