Server `register_function` method improved

* Added check whether function is callable;
* Covered with unit tests.