RESTful API

Implements the RESTful API and resolves #3 #5 and #16.