hooks into the sinatra invoke method and wraps it up