throwing exception on invalid app id + tests