Register rest-api.
Split server and client.