receive post and write to db