add method apply and sub-methods server for apply. (unstable)