add controllers for registration and restore

add controllers for registration and restore. Also fix with JSONobject