40 or so lines? I'm sorry, what? https://github.com/julien-c/Tampon/tree/master/api
Also, I don't think this counts as security:
if (strlen($id) == 24) {
// Looks like a valid MongoId
Edit: this looks bad too: $post = json_decode(file_get_contents('php://input'), true);