Fixed validation errors and wrong response codes

* Fixed bug with empty jsons requests during creating operations.
* Added proper error codes in api functions: 404 NOT_FOUND, 501 NOT_IMPLEMENTED

Fixes bug: #1162746

Change-Id: Ie0ca8c7b8e7077f089b7d3293689e1d87916d732
Merge "Fixed validation errors and wrong response codes"