Fixed two bugs which weren't allowing api registration.
Registration now works.