working register and validate pages, created standard format for json responses