fixes syntax errors, adds appropriate validation/checking for fake api