Made serving code async with 'q' promises