Added registering logic (RESTful API)