Fixed some bugs. Started using promises instead of callbacks in routes.