Fixed 400 error caused by missing check for key in POST dict