Added database code for POST.
GET logic.