Writing a POST function for a create operation