cleaned up api server