Commands

Added commands to RESTful API, and some needed fixes to the rest of the API.