use middleware instead of wrappers and stuff
add CORS