rest api written for registration