Various fixes for REST API

Various set of fixes for the REST API