Use the checkURL func and remove magic

Use the checkURL func and amend settings for tests + add a flow test.
I think we should be in the habit of always doing ``return app.error...`` because something will slip up one day without it. This if statement is kinda big and someone might add code after the last else without seeing a call to ``error.render()`` up at the top.