Initial working version with POST and GET