Added rack middleware to convert json posted data to sinatra params
Refactored webapi function names and return values