fix bug in api/server.js