Added highly sofisticated rest implementation