1. Moved check method to server.rb
2. Added tests