Some POST logic added. Further testing is needed.