Better separation of http request and server funcs