contains code for curl request