added support for additional fields
added additional responses to certain situations
refactored codde