refactored
GET on empty handling added
integration test for post method added