moved server to a more RESTful architecture. Api described in comments.