Split api server and handlers