Made API RESTful
Refactored server class, API bug fixes