fix: check A record in update api, move check to func
feat: api endpoint to update a record
refactor: directory layout