Implemented REST API framework

All REST methods should now be placed inside the RestApi class.