middleware stuff added and in use. woop.