#1161 Source constraints

* Added new validation constraints for Source objects.
* Return appropriate error codes
* Added tests