corrected datamapper to send correct request
cleaned code and added tests