added the helper function add_nested_methods_for_model to client and server methods