implement generic post api