Moved server-side code to gem.