moved api out of package and into server.api.js