Added support for Rails-API, made email attribute name customizable